package net.thetabx.ftdba.activities;

import net.thetabx.ftdba.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;

public class OptionsActivity extends Activity {
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.options);
	}
	
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.main_menu, menu);
        return true;
    }
    
    @Override
    public boolean onPrepareOptionsMenu(Menu menu) {
    	menu.findItem(R.id.menu_options).setVisible(false);
        return true;
    }
    
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle item selection
        switch (item.getItemId()) {
	        case R.id.menu_userstat: {
	        	finish();
	            return true;
	        }
            case R.id.menu_shoutbox: {
            	finish();
        		startActivity(new Intent(this, ShoutboxActivity.class));
        		return true;
            }
            case R.id.menu_userlist: {
            	finish();
        		startActivity(new Intent(this, UserlistActivity.class));
        		return true;
            }
            case R.id.menu_torrents: {
            	finish();
        		startActivity(new Intent(this, TorrentsListActivity.class));
        		return true;
            }
            default:
                return super.onOptionsItemSelected(item);
        }
    }
}
